package com.springmvc.utils.majiang;

import com.springmvc.utils.method.MajiangUtil;
import com.springmvc.utils.method.ToUserUtil;

public class MethodUtil {

	public static void method(Param param) {
		switch (param.getMethod()) {
		case tousermsg://{"userid":"2","method":"tousermsg","msg":"你好"}
			ToUserUtil.tousermsg(param.getUserid(), param.getMsg());
			break;
		case getmajiang://{"roomid":"2","method":"getmajiang"}
			MajiangUtil.getMajiang(param.getRoomid());
			break;
		case setmajiang://{"roomid":"1","method":"setmajiang"}
			MajiangUtil.setMajiang(param.getRoomid());
			break;
		case queuemajiang://{"method":"queuemajiang","roomid":"1","userid":"1","position":"1"}
			MajiangUtil.queueMajiang(param.getRoomid(), param.getUserid(), param.getPosition());
			break;
		case start://{"method":"start","roomid":"1"}
			MajiangUtil.startUserMajiang(param.getRoomid());
			break;
		case play://{"method":"play","roomid":"1","position":"1","mj":"一万"}
			MajiangUtil.playmj(param.getRoomid(), param.getPosition(), param.getMj());
			break;
		default:
			break;
		}
	}

}
